package com.hzdp.jvm;

/**
 * VM Args：-Xss128k
 * 
 */
public class JavaVMStackOSF {

	private int stackLength = 1;

	public void setStack() {
		stackLength++;
		setStack();
	}

	public static void main(String[] args) throws Exception {
		JavaVMStackOSF javaVMStackOSF = new JavaVMStackOSF();
		try {
			javaVMStackOSF.setStack();
		} catch (Exception e) {
			System.err.println("stack length:" + javaVMStackOSF.stackLength);
			Thread.sleep(2000);
			throw e;
		}
	}
}
